<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/static/easyui/themes/default/easyui.css">
<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/static/easyui/themes/icon.css">
<script type="text/javascript" src="${pageContext.request.contextPath}/static/easyui/jquery.min.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/static/easyui/jquery.easyui.min.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/static/easyui/locale/easyui-lang-zh_CN.js"></script>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>请假系统</title>
</head>
<body>
<div id="cc" class="easyui-layout" fit="true" style="width:600px;height:400px;">   
    <div data-options="region:'north'"  style="height:100px;background: url('${pageContext.request.contextPath}/static/images/banner-pic.jpg') no-repeat;background-size: cover;">
   		<table  style="padding: 5px" width="100%">
			<tr>
				<td width="50%">
					<h1>请假管理系统</h1>
				</td>			
				<td  valign="bottom" align="right" width="50%">
					您好,${u.userNickname }[${roleName }]
				</td>
			</tr>
		</table>
    </div>   
    <div data-options="region:'south'" style="height:30px;background-color: #A3BFE6">
    <center style="padding-top: 5px">©版权所有</center>
    </div>   
    <div data-options="region:'west',title:'导航菜单'" style="width:200px;">
    	<div id="myAccordion" class="easyui-accordion" fit="true" style="width:300px;height:200px;">   
		</div>
    </div>   
    <div data-options="region:'center'" style="padding:5px;background:#eee;">
    	<div id="myTabs" class="easyui-tabs" fit="true">
			<div title="欢迎页">
				<h1>欢迎使用员工请假系统</h1>
			</div>
		</div>
    </div>   
</div>  
</body>
<script type="text/javascript">
$(function(){
	var menuList = ${menuList };
	menuList = menuList.menuList;
	for(var i in menuList){
		$("#myAccordion").accordion("add",{
			title:menuList[i].menuName,
			iconCls:menuList[i].menuIcon,
			animate:true,
			selected:false,
			content:"<ul id='"+menuList[i].menuName+"Tree' ></ul>"
		}) 
		var childMenuList = menuList[i].childMenuList;
		var jsArr = [];
		for(var j in childMenuList){
			var js ={
				     id:childMenuList[j].menuId,
				   text:childMenuList[j].menuName,
				iconCls:childMenuList[j].menuIcon,
					url:childMenuList[j].menuHref
			};
			jsArr.push(js);
		}
		$("#"+menuList[i].menuName+"Tree").tree({
			data:jsArr,
			animate:true,
			lines : true,
			onClick:function(node){
				var myTab = $("#myTabs");
				if(myTab.tabs("exists",node.text)){
					myTab.tabs("select",node.text)
				}else if(node.text == "安全退出"){
					$.messager.confirm('确认对话框', '您想要退出该系统吗？', function(r){
						if (r){
							window.location.replace("${pageContext.request.contextPath}/"+node.url);
						}
					});
				}
				else{
					myTab.tabs("add",{
						title:node.text,
						closable:true,
						content:"<iframe src='${pageContext.request.contextPath}/"+node.url+"' style='width:100%;height:100%' frameborder=0></iframe>"
					})
				}
			}
		})
	}
})


	function reloadTabGrid(title){
      	if ($("#myTabs" ).tabs('exists', title)) {
            $( '#myTabs').tabs('select' , title);
            if(title=="待办任务管理"){
            	 window.top.reload_daiBanTable.call();
            }
      	}
    }


</script>
</html>